<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: wickr_cipher_t</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">wickr_cipher_t</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__cipher.html">wickr_cipher</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a cipher that can be used in the crypto_engine. This meta object holds parameters for the cipher algorithms and maintains an identifier that can be used to look up the desired parameters for an algorithm.  <a href="structwickr__cipher.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2b7a8bc33e1fd5af61763398ea9a4013"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structwickr__cipher.html">wickr_cipher_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#ga2b7a8bc33e1fd5af61763398ea9a4013">wickr_cipher_find</a> (uint8_t cipher_id)</td></tr>
<tr class="separator:ga2b7a8bc33e1fd5af61763398ea9a4013"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga234b60967d0b3ef0088ca3ac30755dde"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#ga234b60967d0b3ef0088ca3ac30755dde">wickr_cipher_result_create</a> (<a class="el" href="structwickr__cipher.html">wickr_cipher_t</a> cipher, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *iv, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *cipher_text, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *auth_tag)</td></tr>
<tr class="separator:ga234b60967d0b3ef0088ca3ac30755dde"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gace82050fcc8b7932df9a9e8109a2fc1d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#gace82050fcc8b7932df9a9e8109a2fc1d">wickr_cipher_result_copy</a> (const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *result)</td></tr>
<tr class="separator:gace82050fcc8b7932df9a9e8109a2fc1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad5d22ca53abc4397d88040f0f8003021"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#gad5d22ca53abc4397d88040f0f8003021">wickr_cipher_result_destroy</a> (<a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> **result)</td></tr>
<tr class="separator:gad5d22ca53abc4397d88040f0f8003021"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3f1b679c199987148952816b6fc4c009"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#ga3f1b679c199987148952816b6fc4c009">wickr_cipher_result_is_valid</a> (const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *result)</td></tr>
<tr class="separator:ga3f1b679c199987148952816b6fc4c009"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacda386115dc52f83a0518f8ac0dad6a2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#gacda386115dc52f83a0518f8ac0dad6a2">wickr_cipher_result_serialize</a> (const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *result)</td></tr>
<tr class="separator:gacda386115dc52f83a0518f8ac0dad6a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad42314812c457855c3799632494c91a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#gad42314812c457855c3799632494c91a7">wickr_cipher_result_from_buffer</a> (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer)</td></tr>
<tr class="separator:gad42314812c457855c3799632494c91a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga73e2a916ba0ff19517e30a65a68390f0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#ga73e2a916ba0ff19517e30a65a68390f0">wickr_cipher_key_create</a> (<a class="el" href="structwickr__cipher.html">wickr_cipher_t</a> cipher, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *key_data)</td></tr>
<tr class="separator:ga73e2a916ba0ff19517e30a65a68390f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa473bc83f82d6353aa6f4cb4e36bf4f0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#gaa473bc83f82d6353aa6f4cb4e36bf4f0">wickr_cipher_key_copy</a> (const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *key)</td></tr>
<tr class="separator:gaa473bc83f82d6353aa6f4cb4e36bf4f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga45790b3023ccb261c03346b069aca763"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#ga45790b3023ccb261c03346b069aca763">wickr_cipher_key_destroy</a> (<a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> **key)</td></tr>
<tr class="separator:ga45790b3023ccb261c03346b069aca763"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8716aebf03497c379d5ff81fe32cde32"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#ga8716aebf03497c379d5ff81fe32cde32">wickr_cipher_key_serialize</a> (const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *key)</td></tr>
<tr class="separator:ga8716aebf03497c379d5ff81fe32cde32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1c073b87f2141cf35a1d91ba10f9e5ba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__cipher.html#ga1c073b87f2141cf35a1d91ba10f9e5ba">wickr_cipher_key_from_buffer</a> (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer)</td></tr>
<tr class="separator:ga1c073b87f2141cf35a1d91ba10f9e5ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga2b7a8bc33e1fd5af61763398ea9a4013"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2b7a8bc33e1fd5af61763398ea9a4013">&#9670;&nbsp;</a></span>wickr_cipher_find()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structwickr__cipher.html">wickr_cipher_t</a>* wickr_cipher_find </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>cipher_id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Find a supported cipher by identifier. When cipher results are serialized they contain the identifier of the cipher that was used to create them as the first byte</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cipher_id</td><td>the identifier of the cipher </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a cipher with identifier 'cipher_id'. NULL if cipher is not found </dd></dl>

</div>
</div>
<a id="gaa473bc83f82d6353aa6f4cb4e36bf4f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa473bc83f82d6353aa6f4cb4e36bf4f0">&#9670;&nbsp;</a></span>wickr_cipher_key_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a>* wickr_cipher_key_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a cipher key</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>the key to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated cipher key holding a deep copy of the properties of 'key' </dd></dl>

</div>
</div>
<a id="ga73e2a916ba0ff19517e30a65a68390f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga73e2a916ba0ff19517e30a65a68390f0">&#9670;&nbsp;</a></span>wickr_cipher_key_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a>* wickr_cipher_key_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__cipher.html">wickr_cipher_t</a>&#160;</td>
          <td class="paramname"><em>cipher</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>key_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a key from components</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cipher</td><td>the cipher this key is to be used by </td></tr>
    <tr><td class="paramname">key_data</td><td>a buffer representing the raw bytes of the key </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated cipher key that takes ownership over 'key_data' </dd></dl>

</div>
</div>
<a id="ga45790b3023ccb261c03346b069aca763"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga45790b3023ccb261c03346b069aca763">&#9670;&nbsp;</a></span>wickr_cipher_key_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_cipher_key_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> **&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a cipher key</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>a pointer to the key to destroy. All properties of '*key' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga1c073b87f2141cf35a1d91ba10f9e5ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1c073b87f2141cf35a1d91ba10f9e5ba">&#9670;&nbsp;</a></span>wickr_cipher_key_from_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a>* wickr_cipher_key_from_buffer </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a cipher key from serialized bytes</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>a buffer created by 'wickr_cipher_key_serialize' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>cipher key parsed from 'buffer'. This function makes a copy of all bytes as it is parsing, so the resulting cipher key owns its properties. Returns NULL on parsing failure </dd></dl>

</div>
</div>
<a id="ga8716aebf03497c379d5ff81fe32cde32"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8716aebf03497c379d5ff81fe32cde32">&#9670;&nbsp;</a></span>wickr_cipher_key_serialize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>* wickr_cipher_key_serialize </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serialize a cipher key</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>the key to serialize to a buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated buffer containing properties of 'key' in the following format: | CIPHER_ID | KEY_DATA | </dd></dl>

</div>
</div>
<a id="gace82050fcc8b7932df9a9e8109a2fc1d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gace82050fcc8b7932df9a9e8109a2fc1d">&#9670;&nbsp;</a></span>wickr_cipher_result_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a>* wickr_cipher_result_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td>
          <td class="paramname"><em>result</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a cipher result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">result</td><td>the source of the copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A newly allocated cipher_result that contains deep copies of all the properties of 'result' </dd></dl>

</div>
</div>
<a id="ga234b60967d0b3ef0088ca3ac30755dde"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga234b60967d0b3ef0088ca3ac30755dde">&#9670;&nbsp;</a></span>wickr_cipher_result_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a>* wickr_cipher_result_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__cipher.html">wickr_cipher_t</a>&#160;</td>
          <td class="paramname"><em>cipher</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>iv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>cipher_text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>auth_tag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Construct a cipher result from individual components.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cipher</td><td>the cipher used in the cipher operation </td></tr>
    <tr><td class="paramname">iv</td><td>the initialization vector used in the cipher operation </td></tr>
    <tr><td class="paramname">cipher_text</td><td>the output bytes of a cipher function using 'cipher' and 'iv' </td></tr>
    <tr><td class="paramname">auth_tag</td><td>the authentication tag associated with 'cipher_text'. If 'cipher' is authenticated this property is required, otherwise it should be NULL </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A newly allocated cipher result that takes ownership of the passed inputs, or NULL if allocation fails </dd></dl>

</div>
</div>
<a id="gad5d22ca53abc4397d88040f0f8003021"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad5d22ca53abc4397d88040f0f8003021">&#9670;&nbsp;</a></span>wickr_cipher_result_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_cipher_result_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> **&#160;</td>
          <td class="paramname"><em>result</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a cipher result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">result</td><td>a pointer to the cipher result to destroy. Destruction will also destroy the individual properties of 'result' </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gad42314812c457855c3799632494c91a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad42314812c457855c3799632494c91a7">&#9670;&nbsp;</a></span>wickr_cipher_result_from_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a>* wickr_cipher_result_from_buffer </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a cipher result from a serialized cipher result buffer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>a buffer created by 'wickr_cipher_result_serialize' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>cipher result parsed from 'buffer'. This function makes a copy of all bytes as it is parsing, so the resulting cipher result owns its properties. Returns NULL on parsing failure </dd></dl>

</div>
</div>
<a id="ga3f1b679c199987148952816b6fc4c009"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3f1b679c199987148952816b6fc4c009">&#9670;&nbsp;</a></span>wickr_cipher_result_is_valid()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wickr_cipher_result_is_valid </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td>
          <td class="paramname"><em>result</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Determine if a cipher result is formed correctly</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">result</td><td>the cipher result to validate </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if result is structured correctly, false if a required field is missing </dd></dl>

</div>
</div>
<a id="gacda386115dc52f83a0518f8ac0dad6a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacda386115dc52f83a0518f8ac0dad6a2">&#9670;&nbsp;</a></span>wickr_cipher_result_serialize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>* wickr_cipher_result_serialize </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td>
          <td class="paramname"><em>result</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serialize a cipher result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">result</td><td>the cipher result to serialize </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer containing bytes representing the cipher result in the following format: | CIPHER_ID | IV | AUTH_TAG (IF REQUIRED) | CIPHER_TEXT | </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
